/**
 * 中心弹窗样式
 * 美观的页面中心弹窗样式，替代从右侧滑入的通知效果
 */

/* 弹窗容器 */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-container.visible {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-container.visible .modal-dialog {
    transform: scale(1);
    opacity: 1;
}

/* 对话框尺寸 */
.modal-dialog.small {
    width: 400px;
}

.modal-dialog.medium {
    width: 600px;
}

.modal-dialog.large {
    width: 800px;
}

.modal-dialog.full {
    width: 90%;
    height: 90vh;
}

@media (max-width: 768px) {
    .modal-dialog.small,
    .modal-dialog.medium,
    .modal-dialog.large {
        width: 95%;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 60px);
}

/* 表单对话框样式 */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

/* 确认对话框样式 */
.confirm-dialog {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.confirm-dialog p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.5;
}

/* 消息提示样式 */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    font-size: 14px;
    max-width: 400px;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.message-container.visible {
    transform: translateY(0);
    opacity: 1;
}

.message-container.info {
    background-color: var(--info-color);
    color: white;
}

.message-container.success {
    background-color: var(--success-color);
    color: white;
}

.message-container.warning {
    background-color: var(--warning-color);
    color: white;
}

.message-container.error {
    background-color: var(--error-color);
    color: white;
}

/* 表单控件样式统一 */
.modal-dialog .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
}

.modal-dialog .form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.modal-dialog .form-group {
    margin-bottom: 15px;
}

.modal-dialog .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-dialog .form-group .help-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* 消息弹窗特有样式 */
.message-modal {
    flex-direction: row;
    align-items: center;
    padding: 15px 20px;
    width: 400px;
    max-width: 90vw;
}

.modal-icon {
    margin-right: 15px;
    font-size: 24px;
    flex-shrink: 0;
}

.modal-message {
    flex: 1;
    font-size: 16px;
}

/* 不同类型消息的颜色 */
.message-modal.info .modal-icon {
    color: var(--info-color, #2196F3);
}

.message-modal.success .modal-icon {
    color: var(--success-color, #4CAF50);
}

.message-modal.warning .modal-icon {
    color: var(--warning-color, #FF9800);
}

.message-modal.error .modal-icon {
    color: var(--danger-color, #F44336);
}

/* 表单弹窗特有样式 */
.form-modal {
    width: 500px;
    max-width: 95vw;
}

/* 确认弹窗特有样式 */
.confirm-modal {
    width: 450px;
    max-width: 95vw;
}

.confirm-icon {
    font-size: 48px;
    color: var(--warning-color, #FF9800);
    margin-bottom: 15px;
    text-align: center;
}

.confirm-modal .modal-body p {
    text-align: center;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

/* 详情弹窗特有样式 */
.detail-modal.small {
    width: 400px;
    max-width: 95vw;
}

.detail-modal.medium {
    width: 600px;
    max-width: 95vw;
}

.detail-modal.large {
    width: 800px;
    max-width: 95vw;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-size: 14px;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary, #1976D2);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark, #1565C0);
}

.btn-secondary {
    background-color: #f1f1f1;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
    }
    
    .message-modal,
    .form-modal,
    .confirm-modal,
    .detail-modal.small,
    .detail-modal.medium,
    .detail-modal.large {
        width: 95vw;
    }
} 